home *** CD-ROM | disk | FTP | other *** search
- ' ===========================================================================
- ' ImageDTInfo by © 1999-2002 Dámaso D. Estévez
- ' Fido : 2:348/613.44
- ' Inet : amidde@arrakis.es
- ' WWW : http://www.arrakis.es/~amidde/
- '
- ' ImageDTInfo.bas (main code/código principal)
- '
- ' NOTA: El fichero GetCString.bas original del paquete HBasic
- ' lo he modificado para que incluya la función del usuario liStr$()
- ' y el dimensionado de la matriz localeInfo&().
- ' --------------
- ' NOTE: I've modified the original HBasic's GetCString.bas file
- ' for to include the liStr$ user function and & the DIM localeInfo&() command
- ' ===========================================================================
- ' Created for use with FWCalendar Arexx script written by Ron Goertz
- ' and as a little coding exercise with (Hisoft|Maxon) Basic 2.
- ' You can re-use freely this code in your own works.
- ' ------------
- ' Creado para usar con el guión ARexx FWCalendar de Ron Goertz
- ' y como un pequeño ejercicio de programación con (Hisoft|Maxon) Basic 2.
- ' Puede reutilizar libremente este código en sus producciones.
- ' ===========================================================================
-
- REM $NOWINDOW
-
- ' ------------- Opening libraries -------------
- ' -- (OS datatypes system appears from v39) ---
-
- ' ---------- Apertura de bibliotecas ----------
- ' --- (el sistema de tipos de datos aparece ---
- ' --- a partir de la versión 39 del S.O. ;) ---
- ' ---------------------------------------------
-
- ' CacheClearE(), AllocMem(), Freemem()
- LIBRARY OPEN "exec.library"
-
- ' OpenCatalogA(), CloseCatalog()
- LIBRARY OPEN "locale.library",38&
-
- ' ----- Locale support ------
- ' ---- Prestación local -----
- ' ---------------------------
- REM $include BH:BLib/GetCString.bas
- REM $include Locale/ImageDTInfo_Locale.bc
- REM $include Locale/ImageDTInfo_Locale.bas
-
- localeInfo&(0) = LIBRARY("locale.library")
- IF localeInfo&(0) <> NULL& THEN
- localeInfo&(1) = OpenCatalogA&(NULL&, SADD("ImageDTInfo.catalog" + CHR$(0)), NULL&)
- END IF
-
- ' - Loading my modules with functions/subroutines -
- ' - Cargando mis módulos con funciones/subrutinas -
- ' -------------------------------------------------
- REM $include BH:BLib/AST_generic01.bas ' SGetARg, FixPath, ChangeExt
- REM $include BH:BLib/AST_filesystem01.bas ' MKD, Exists
- REM $include BH:BLib/AST_filesystem02.bas ' CopyFile
- REM $include Specific/IDTI_specific.bas ' InfoImgFile
-
- ' --------- Shared vars for error handling --------
- ' -- Variables compartidas de gestión de errores --
- ' -------------------------------------------------
- en& = 0&
- em$ = ""
-
- ' ---- Calling the main routine ----
- ' - Llamando a la rutina principal -
- ' ----------------------------------
- CALL main(COMMAND$)
-
- IF LIBRARY("locale.library") <> NULL& THEN
- CloseCatalog localeInfo&(1)
- END IF
-
- LIBRARY CLOSE
-
- END
-
- ' =====================================================================
- ' "Main"subroutine / Sub-rutina "Main"
- ' =====================================================================
-
- SUB main(cad$)
- SHARED en&,em$
- LOCAL ver$,tmp$
-
- ' -- Variables initialization ---
- ' - Inicialización de variables -
- '--------------------------------
-
- ' Copyright string / Cadena de autoría
- ver$ = "$VER: ImageDTInfo 2.04 (5.2.02) © Dámaso D. Estévez <ast_dde@yahoo.es> "+CHR$(0)
-
- ' ---- Asking the first argument ----
- ' - Solicitando el primer argumento -
- ' -----------------------------------
- cad$ = SGetArg$(cad$,1,liStr$(MSG_TEMPLATE&))
-
- ' - There is the argument? -
- ' ---- ¿Hay argumento? -----
- ' --------------------------
- IF cad$ <> "" THEN
-
- tmp$ = InfoImgFile$(cad$)
-
- IF tmp$ <> "" AND en& = 0 AND em$ = "" THEN
-
- PRINT tmp$
-
- ELSE
-
- ' --------- If there was some error, -----------
- ' ------ prints the error code (& message) -----
-
- ' - Si se ha producido algún error, se imprime -
- ' ------ el código (y el mensaje de error) -----
- ' ----------------------------------------------
-
- PRINT liStr$(ERROR_TITLE&);
- IF en& <> 0 THEN
- PRINT " - ";liStr$(ERROR_CODE_INFO&);en&
- ELSE
- PRINT
- END IF
-
- PRINT liStr$(ERROR_ARG_INFO&)": `";cad$;"'"
-
- IF em$ <> "" THEN
- PRINT em$
- END IF
-
- END IF
-
- ELSE
-
- ' -------- The user didn't include a filename as argument ----------
- ' - El usuario no ha incluído un nombre de fichero como argumento --
- ' ------------------------------------------------------------------
- PRINT
-
- PRINT RIGHT$(ver$,LEN(ver$)-6)
- PRINT
- PRINT liStr$(ERROR_ONLY_ONE_ARG&)
- PRINT
-
- END IF
-
- END SUB
-